#include<bits/stdc++.h>
using namespace std;

int main() {
	int n, m;
	cin >> n >> m;
	int ret = 0;
	int t = 0;
	string s;
	cin >> s;
	for(int i = 0; i < s.size(); i ++ ) {
		if(s[i] == 'O') {
			t ++ ;
		}
		if(s[i] == 'X') {
			t = 0;
		}
		if(t == m) {
			ret ++ ;
			t = 0;
		}
	}
	cout << ret << endl;
	return 0;
}

